package com.xnyzc.lhy.common.penum.order;

public enum EOrderOperation {

    no(0, "暂无"),
    cancel(1, "订单取消"),
    close(2, "关闭订单"),
    freeCharge(3, "乘客免单"),
    change(4, "订单改价"),
    refund(5, "订单退款");

    private Integer type;
    private String value;

    EOrderOperation(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public static EOrderOperation findById(Integer type) {
        EOrderOperation ePaymentType;
        switch (type) {
            case 0:
                ePaymentType = EOrderOperation.no;
                break;
            case 1:
                ePaymentType = EOrderOperation.cancel;
                break;
            case 2:
                ePaymentType = EOrderOperation.close;
                break;
            case 3:
                ePaymentType = EOrderOperation.freeCharge;
                break;
            case 4:
                ePaymentType = EOrderOperation.change;
                break;
            case 5:
                ePaymentType = EOrderOperation.refund;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return ePaymentType;
    }

    public String getValue() {
        return this.value;
    }

    public Integer getType() {
        return this.type;
    }
}
